

export default defineNuxtPlugin( nuxtApp => {
    nuxtApp.vueApp.directive('permission', {
        updated(el, binding) {
            var values = binding.value
            var permissionList = values[0]
            var code = values[1]
            var len = permissionList.filter(c => c == code).length
            el.style.display = len == 0 ? "none" : "block"
        },
        getSSRProps() {
            return {}
        }
    })
})